package edu.sctu.xiangkun.day201505.day20150518;

/**
 * Created by user08 on 2015/5/18.
 */
public class TextOne extends TextMore {
    Student[] studentcode1 = new Student[teacher[0].student.length];
    Student[] studentcode3 = new Student[6];

    public TextOne(Teacher[] teacher){
        super(teacher);
    }
    public void getTeacherInfo(){

        sotrNumber();
        System.out.println("老师学号排序: \n姓名："+teacher[0].name+"\t学号："+teacher[0].number+"\n姓名："+teacher[1].name+"\t学号："+teacher[1].number);
    }
    public Student[] getStudent(int code,Student[] student){
        System.out.println("成绩大于code：");
        Student[] studentcode1 = new Student[student.length];
        for(int i=0;i<student.length;i++){
            if(student[i].grade>code){
                studentcode1[i] = student[i];

                System.out.println("姓名："+student[i].name+"\t学号:"+student[i].number+"\t成绩："+student[i].grade);
            }
        }
        return studentcode1;
    }
    public Student[] getCode(){
        Teacher teacher = pritCoded();
        Student[] studentnumber = interFace.getStudents(teacher.student);
        return studentnumber;
    }
    StudentInterface interFace = new StudentInterface(){
        public Student[] getStudents(Student[] student){
            Student[] studentnumber = getStudent(60,student);
            return studentnumber;
        }
    };


}

